import { http } from "@/utils/http"
import { useUserStore } from "@/store"
const userStore = useUserStore()
export interface CreateVideoParams {
  appid: string
  image_url: string
  role_id: number
  caption: string
  uid: string
}

// 获取任务列表
export const getRoleList = () => {
  return http({
    url: "/roles",
    method: "GET",
    header: undefined,
  })
}

// 获取任务列表
export const getTaskList = () => {
  return http({
    url: "/videos",
    method: "GET",
  })
}

// 创建视频
export const createVideo = ({
  appid = "test_appid",
  imageUrl = "",
  roleId = 1,
  caption = "",
  voiceOptions = {},
}) => {
  return http<CreateVideoParams>({
    url: "/create/video",
    method: "POST",
    data: {
      appid,
      image_url: imageUrl,
      role_id: roleId,
      caption,
      voice_options: voiceOptions,
    },
  })
}
